-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: broken traces #467
fix: broken traces #467
Conversation
29ce080
to
9eaa029
Compare
d11e439
to
d6d3f7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have some tests to ensure that the traces don't break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just added some minor comments
|
cf9573a
to
a935e13
Compare
Activity.Current is a static variable that uses AsyncLocal internally, which means that it flows into async calls, but not back out into the caller (message consumer and producer). As so, the activity.current is null after the produce and consume of the message, which means that all the spans created after it will be generate a new trace because the context is not being propagated.
a935e13
to
8172b54
Compare
Description
Fixes broken traces by changing the Activity creation to
KafkaFlow
project, just before the messages are consumed and produced.The error appeared because the Activity context, being created in
KafkaFlow.OpenTelemetry
, could not be propagated through the system and the next time a span would be created the existing Activity would be null, forcing the creation of a new trace instead of using the previous oneCloses #468
How Has This Been Tested?
Integration tests
Checklist
Disclaimer
By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement